﻿using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WebStickyNotes.Helpers;

namespace WebStickyNotes.Test
{
    public class TestObject
    {
        public int Identifier { get; set; }
        public string Description { get; set; }
    }

    [TestClass]
    public class MegaSelectListTest
    {
        [TestMethod]
        public void MegaSelectList_Items_Matches()
        {

            var testObjects = new List<TestObject>
                                  {
                                      new TestObject {Description = "Test0", Identifier = 0},
                                      new TestObject {Description = "Test1", Identifier = 1},
                                      new TestObject {Description = "Test2", Identifier = 2},
                                      new TestObject {Description = "Test3", Identifier = 3}
                                  };

            var megaSelectList = new MegaSelectList(testObjects, "Identifier", string.Empty, "Description", 2);

            Assert.AreEqual(testObjects[0].Identifier.ToString(), megaSelectList.Items[0].Value);
        }
    }
}
